#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>

#define BUFSIZE		10001

using namespace std;

vector<int>	prime;
int	flags[BUFSIZE];
int	array[BUFSIZE] = {0};
int	table[1000][1000] = {0};

int
main(int argc, char *argv[])
{
	fill_n(flags, BUFSIZE, 1);
	flags[0] = flags[1] = 0;
	
	for (int i = 2; i < BUFSIZE; ++i)
	{
		if (flags[i])
		{
			prime.push_back(i);
			
			int	t = i + i;
			while (t < BUFSIZE)
			{
				flags[t] = 0;
				t += i;
			}
		}
	}
		
	for (int i = 0; i < 10; ++i)
	{
		int	t;
		scanf("%d", &t);
		
		for (int j = 0; j < prime.size(); ++j)
		{
			while (t%prime[j] == 0)
			{
				t /= prime[j];
				++array[j];
			}
		}
	}
	
	int	product = 1;
	for (int i = 0; i < prime.size(); ++i)
	{
		if (array[i])
		{
			product *= array[i] + 1;
			product %= 10;
		}
	}
	
	printf("%d\n", product);
	
	return 0;
}
